$(function(){
    init();
})

/**
 * 页面初始化
 */
function init(){
    $(".loding").show(0);
    var that=this;
    var userData=baseFunction.getUserInfo();
    var loginName = JSON.parse(JSON.parse(userData).user).loginName;
    var data={
        userName: baseFunction.encryption(loginName) ,
        queryType:"4610"
    }
    baseFunction.netRequest("param",data,function(res){
        $(".loding").hide(0);
        
        var data = JSON.parse(JSON.parse(res.data).result) ; 
        $("#totalAssets").html((data.account).toFixed(2));//总余额
        $("#accountBalance .right text").html((data.account).toFixed(2));//账户余额
        $("#profitDistribution .right text").html((data.profit).toFixed(2));//分润余额
        $("#promotionIncome .right text").html((data.extension).toFixed(2));//推广余额
    })


    // 账户余额
    $("#accountBalance").click(function(){
        window.location.href="wallet_accountBalance.html?loginName="+loginName+"";
    })
    // 分润收益
    $("#profitDistribution").click(function(){
        window.location.href="wallet_profitDistribution.html?loginName="+loginName+"";
    })
     // 推广收益
    $("#promotionIncome").click(function(){
        window.location.href="wallet_promotionIncome.html?loginName="+loginName+"";
    })

}